package com.test;

import com.Dao.OrdersDao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/* Bean的创建方式三: */
public class DemoTest01 {
    public static void main(String[] args) {
        ApplicationContext ctx =
                new ClassPathXmlApplicationContext("applicationContext.xml");

        OrdersDao ordersDao1 = (OrdersDao)ctx.getBean("ordersDao1");
        OrdersDao ordersDao2 = (OrdersDao)ctx.getBean("ordersDao1");
        System.out.println(ordersDao1);
        System.out.println(ordersDao2);
    }
}
